package hy.config;

import com.alipay.api.DefaultAlipayClient;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class AlipayConfig {
//用于产生alipayClient实例并注入配置
    @Bean(name="alipayClient")
    public DefaultAlipayClient alipayClient(){
        DefaultAlipayClient alipayClient =
                new DefaultAlipayClient("https://openapi.alipaydev.com/gateway.do"
                        ,"2016100100639965"
                        ,"MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQC6uc+1gYKrlNNTfigboSHDHqRQMdsetA60irBe2fZvk0QWTQXcZ2HKtdLdYD1/vg9CSlw9l0turu3TuFxP1e+J3kt/1ciS9c8F4WV2UQJBEi60ou5EFzSNzJ7O6Y7YK6QnBsNsnDFg3q6xF26YXLTxFsVUunCi/m2wXbYTUrntk7lWfKaWMrCADmeXi+FacVlqti05yc2+B2JbZWJ9ib+7ylSl0zrZy0pjrgKy3ezy304pJwm2SohpaZTnEvVpHIroYPmS0Rx+ZwXwz8v1KXqdxXpqiY9EJJjFXokKEqqRTUE/TKomYls6EnqABRhHl9zF7VKBJB03wIh4M+R5pyDVAgMBAAECggEALJHLhVx7by8f3g7/zdCBOYyn1ciAr+x0kh2Eia9nBizVlKkf3AMFMZiC03p0U3hvNfh/2eeyBqJUfDPGPPwop/TaepHxxTpNBu9NA5fEfPm1EkLNso0Da1FLGsJe6TRJg1M29Ea39pJQik64hD+kpOM1iMrTteQbFHzZx/T4Ej/HHdhWQzemwKPk8apyYN5GJTqDhwT0a4vWn0xlu1HTfNM656ZdUfwCps06QeR4WlozjnjLkvpquXMr0tqxW98gWg/uNE19mgQmw6J4sBFRUT0l10+kzotk9R7urcli+yIHjdh2gFvL/qIwtPTo3hZi7CMdHk3ENsPK/APeYk8VBQKBgQDcU0O9VGjiBJn0wLCmeZY9Mz2U4+Z9i3r3MN7xR63KDHLXXz+AG4H7V+Qeh+P1ZakdIoeey+hpCb5etZONSYhUeqqFjFGhvfU5YV2m6AhUmtZboZjvUFm6YAtszwtsSrW8uRE5uGQyTtxKq3RmwET4c/ZTvIVBrN2UUsY6XgKiUwKBgQDY9c/UK2smq1QmjVql93psuZiPaGOXrBaWOHfLgGSxlDJUGlqhx971J8Znj8pKky0HTNLNrtSmlbEdcuaV4y8Bwy7pp3ymX3f9GlVBRbhW+7WcoBnYwK5JdutCpOjjxJpzwIp6J0pd1i3u6Eqe6+ZbqaHgOU5Q9CnV0yFleDqbNwKBgE38FuUD5J/jmw7byWsTbE87PNffluznGt416SOkCGqU321GJHbWxbpOUMtRtClfE23hk/lsGVZcgYqKYLDIzz1/sa3VjetfDlaCFSEHzjMMH0WNvFEwsqHabxDTdCqfgxZKt0Mj9issaKLxbyETexYqDY10FAK8Ci3+4nU0Y2BLAoGBAJyAJBxd/Xr1V0w/5sWVUMAg2MWJfV2pCtntfaxTv07BIdS89eeBL3kT6fBGLpvAslhzuBQaKtbHX+1oNqCkMgJJcwukfyvb7cerORhOXHySMRz79+j8hDwGBgoavsudw/P/TWRz9xbdKmENOtaMP6ybHmOJss5+cbcGBy8UnOHdAoGAKnXZpy01PRdNsLe4OcLxCBNFBc1OSLDfsF46WAnxSpIQ9cnE4w8vI5iAdavqhclONTz8OT34dgn+BVaL/SBl8M8xEsfxnQFUe19dnZ2jlLGcW666mlnX885urYfLmp1KE81qRGhAxmIIeWHHvHdvZMehldkaT/W9J5rbykyurIs="//私钥需要每个人自行进行保护,是个人身份的证明
                        ,"json"
                        ,"utf-8"
                        ,"MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsgi2aVVSiPD0Dxw5Avy+NTIWmAqLxnuBl72wiW31R1L62v6t80Gqi9xcDKgsNPx+zDAgyntLLGl3gQt0eIjOTol/ZKMK2NHbga1DOu1AEAqFGC943MZORknpMVvNaXKzkIrK0V7t6o3pBmbsYzgPHXCCSvNLhjGLio7/TPtXEyg5WTHfZb4sq0adHf6Rcarc+NytR7QhaWu/kkg84Deee3Q0TYLRCt2YyDTZg/4upHHSnKnsE/0KgRjwZkaXwvhzoHSOIhJJM0FhWMUgavwFHjiol1LcppfPhH9cJIZMorB+Z1Z9P4ACTHFKMPRhRVyYrjPdqpaQipknaOXt70xDHQIDAQAB"//可以随便分享
                        ,"RSA2");//RSA2是加密方式
        return alipayClient;
    }
}